package unit2;


public class Ex2_27_StrBufferDemo {
    public static void main(String[] args) {
        StringBuffer s1 = new StringBuffer("It is wild.");
        System.out.println(s1.capacity());
        System.out.println(s1.length());
        s1. setCharAt(6, 'm');
        System.out.println(s1);
        StringBuffer s2 = new StringBuffer("Good morning!");
        s2. replace(5, 12, "afternoon ");
        System.out.println(s2);
        StringBuffer s3 = new StringBuffer("Hello");
        s3.append(" students.");
        s3.insert(6, "all");
        System.out.println(s3);
        StringBuffer s4 = new StringBuffer("Hello all students.");
        s4.delete(6, 10);
        System.out.println(s4);
    }
}
